UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ek5kk2Zf0zrcaRwzDjNpBnWtZcsOM6ZOpqLR9WpJhBo='
WHERE
key_id = '4f8629a6b4c6435f3fbcb19f1c4d66bd959f7d84a0d1620b7cbb3ed5e982f989'
AND (
token = 'ek5kk2Zf0zrcaRwzDjNpBnWtZcsOM6ZOpqLR9WpJhBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)