UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bp+gT/uKg2xKJHmjb6EFEdbdAWx4x/iwJKcNCQzTl/o=' 
WHERE 
  key_id = '62b76228f8e1b5601c783e6208c72e7dc09227759226f131286055cdd1b94944' 
  AND (
    token = 'Bp+gT/uKg2xKJHmjb6EFEdbdAWx4x/iwJKcNCQzTl/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029