UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VBj9ABTKsl4Boqzths1bQRbMHbkV8PBMOGHZWJuPPVg=' 
WHERE 
  key_id = '2d22d7eaea6523eaa6bb75fda66cf2ae21f171152c2c2f6cf71516b3ca6f466a' 
  AND (
    token = 'VBj9ABTKsl4Boqzths1bQRbMHbkV8PBMOGHZWJuPPVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026