UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7JchUlNTwTMjAo9/8xrf9Jwr5BKNquUyxNUo2wtww9k='
WHERE
key_id = '98995f1843a7fe83b53cbc0f4b271e06ba65c2dbd19683bcec10b1c0b4efeab4'
AND (
token = '7JchUlNTwTMjAo9/8xrf9Jwr5BKNquUyxNUo2wtww9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)