UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eIIR1kL2VMlkWsHVNS0R2b0wx+7/mfL9ea5x4TH9RJU='
WHERE
key_id = '8aac4e61d039393a510f449f88238dbd6bbfb8bd71fb9328cb95d35767b3e83a'
AND (
token = 'eIIR1kL2VMlkWsHVNS0R2b0wx+7/mfL9ea5x4TH9RJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)