UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u4Xyulgk6sQ2AvbCkV1prfC0WRirfmm51mrGkkbhT5Y='
WHERE
key_id = 'ec6064fc241168e39e784e39a397a23e0807d0aa45aa4bda003ff5096d547d60'
AND (
token = 'u4Xyulgk6sQ2AvbCkV1prfC0WRirfmm51mrGkkbhT5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)