UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ptYGlfzwAEQr/vuK6McBxRVUoSCmw9dp39pisYyRaCU='
WHERE
key_id = '280693143131bd011d52d12c61959da9ba3ae9c5d8cd10507a196003f0fd58a0'
AND (
token = 'ptYGlfzwAEQr/vuK6McBxRVUoSCmw9dp39pisYyRaCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)