UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZdqedAcZtuU8HcelRIv/Vbjy4xIO9zNBnlT8M/gja6M='
WHERE
key_id = '5be91a46ded84ccc6158e97b479c4fe1e3edda1b10b9f037efa7a1ca083b8f75'
AND (
token = 'ZdqedAcZtuU8HcelRIv/Vbjy4xIO9zNBnlT8M/gja6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)