UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ea7DhLailqRY2u+XYYhZ/J4q6GxtNqPaByNXb6xLPSg='
WHERE
key_id = '136d406ec982560e941030f595438ccaea2f2956d1e57172ca9733b0751aabcf'
AND (
token = 'Ea7DhLailqRY2u+XYYhZ/J4q6GxtNqPaByNXb6xLPSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)