UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10Rsl3ZS+TabApCHSiX5pc8I5+GZjK+ptCHFoNBZS2c='
WHERE
key_id = '278727b18b20c361c83d49e4532041f57b41e8e675904c5057bd5bf420b18250'
AND (
token = '10Rsl3ZS+TabApCHSiX5pc8I5+GZjK+ptCHFoNBZS2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)