UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vp5SPDrNeuT0uBlcHove62Mwh4yQtWLDvw1HX0ltnLw=' 
WHERE 
  key_id = 'baf649c396143551f915957857627d6889bded6f91cf5032ddff1d22469f2974' 
  AND (
    token = 'vp5SPDrNeuT0uBlcHove62Mwh4yQtWLDvw1HX0ltnLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025