UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J9Rpkq35CEgaKAKs7oXI/cnvLUKopZZ/iIfqqNsTQyk='
WHERE
key_id = '4b389ffcac30ef21b4f00c78bc046c37ad65806ff971aab51274c93fccc45e48'
AND (
token = 'J9Rpkq35CEgaKAKs7oXI/cnvLUKopZZ/iIfqqNsTQyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)