UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UA0kmr7zJs+j3IdyW9Aur3CiwtPxN64efPdbNrA/HvI='
WHERE
key_id = '996f95bbf382723a1b1833d114df2152cc442f6ed942c36afa6d8caaac04d0e7'
AND (
token = 'UA0kmr7zJs+j3IdyW9Aur3CiwtPxN64efPdbNrA/HvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)