UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c5Ht8W0UXdV2sXavff8JHWLkwsxVHY4dqnjdB0MITH8='
WHERE
key_id = '5620b7f57110847269dd5eaa015c851142b5da32791e9dd1776574c068c7bfbd'
AND (
token = 'c5Ht8W0UXdV2sXavff8JHWLkwsxVHY4dqnjdB0MITH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)