UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AqhiKa8jifo0WbKhKnkYbuV9Fuu0QQc/+1MkXBa1BLk='
WHERE
key_id = '4a1cbcad47d3a0c34722504f637dc548ba92eca65f579a70b975567eb339f25f'
AND (
token = 'AqhiKa8jifo0WbKhKnkYbuV9Fuu0QQc/+1MkXBa1BLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)