UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GR5fxIwkoWLewtJDB+F9lJv4iSZXmc0qOmt1SV4w0Kc=' 
WHERE 
  key_id = '42b1b1f130e98db8be2629e3925868bd5f4fece21dc3ab7f358c91aa71ed26bb' 
  AND (
    token = 'GR5fxIwkoWLewtJDB+F9lJv4iSZXmc0qOmt1SV4w0Kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053