UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'asjGG1JQNzYCX9iCllgC3MBwky2BIbQ0T319z2PWS5U='
WHERE
key_id = '0b2a889b36998bf0b83c634c3f95f4eee5c7ac0e502d79c8bf60cefc5ac0906f'
AND (
token = 'asjGG1JQNzYCX9iCllgC3MBwky2BIbQ0T319z2PWS5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)