UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X+02F0lysntSWHsAsbDZJNp4BV8GbS64uu/Ic8bMrCA=' 
WHERE 
  key_id = '32c90f704be28e76fdba7242dc38de86c258fe33b27c1a6e3856be0edc3d130d' 
  AND (
    token = 'X+02F0lysntSWHsAsbDZJNp4BV8GbS64uu/Ic8bMrCA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029