UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O5RXSOM1yGjFW5eETvdrJYB9r1HQ5FplXU4NNdACxVE='
WHERE
key_id = '144d2892cc6b08eb002d9d6412b0d69c4a371ab79ca5d7426ed40f283ac666ed'
AND (
token = 'O5RXSOM1yGjFW5eETvdrJYB9r1HQ5FplXU4NNdACxVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)