UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ua3wsC278zSUbpts7lhLDHEVd3QmD1RuyiERZpOy2wo=' 
WHERE 
  key_id = '8d622cb03adede11a837b22b1ec59b3e7d10ceea74c4e8aceddbef838064caec' 
  AND (
    token = 'ua3wsC278zSUbpts7lhLDHEVd3QmD1RuyiERZpOy2wo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031