UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sjBLgV6AojRSmLF4EUPZhFUQdmZTrNIlpzoso05RLnU='
WHERE
key_id = '396abccee4f5ab0fcac25accaee1bcde7c335b51183ae9a63f8a88ac8b09da9b'
AND (
token = 'sjBLgV6AojRSmLF4EUPZhFUQdmZTrNIlpzoso05RLnU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)