UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sJ4Ie9awvEPAVutPW39w8w+c1Bl/PqcfDbWjfN7k/Fg=' 
WHERE 
  key_id = '829a1c7da88c7bb133bf655633316841b6bcecf513bf5ef21515b69566f6dd5c' 
  AND (
    token = 'sJ4Ie9awvEPAVutPW39w8w+c1Bl/PqcfDbWjfN7k/Fg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015