UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tsmGmeO7Wce9a+VL+j8tZqWM25DiElctEn3KVLcd0A4='
WHERE
key_id = 'f2c3d8f5f8178a9820ba91bae90d3c92ef8882a1a4c95e34eeed1f6e2762f3c9'
AND (
token = 'tsmGmeO7Wce9a+VL+j8tZqWM25DiElctEn3KVLcd0A4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)