UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FPgCegVujgHNy0Cnn+69tXya4qW4mDTe8Un7+SULEMA='
WHERE
key_id = 'fecf2cf08a4b56ebba23d53746d051d5556e8271ff7735e651008b7afa581cf7'
AND (
token = 'FPgCegVujgHNy0Cnn+69tXya4qW4mDTe8Un7+SULEMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)