UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j5MwPwSUJMc00fg6hlWG5baT6+JJ2scWYFEXJbhQfwQ=' 
WHERE 
  key_id = '770d595608fdb15061260bfae431a9a268dfb49e76a15323ac0503b36762078f' 
  AND (
    token = 'j5MwPwSUJMc00fg6hlWG5baT6+JJ2scWYFEXJbhQfwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022