UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xd9iiFKnY9kqpmffIQghYp4bW4unAZ3074Z0uIUil8I='
WHERE
key_id = '5dff4c433ceb6b37c634fcd6f08b55dcff8b1e46259e55ce40ccd88c21764d73'
AND (
token = 'Xd9iiFKnY9kqpmffIQghYp4bW4unAZ3074Z0uIUil8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)