UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WHBTQzDgg9h1mPHSKwuZDR7SNS8NPs3kwf2rdywm6FI='
WHERE
key_id = 'f5ceffcc6f12e4be383aed62cc1650bc10074a37bcc13e0b4738a35e65934f6a'
AND (
token = 'WHBTQzDgg9h1mPHSKwuZDR7SNS8NPs3kwf2rdywm6FI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)