UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cmrw02Mg2Dtj4SUYQXGF6P4E0EAtaTPuOl9gsGseFU0=' 
WHERE 
  key_id = '3c9e334dc766a6680bc536fe3a9224a4b74f3c9e8bd094973ea1f22b9b069381' 
  AND (
    token = 'cmrw02Mg2Dtj4SUYQXGF6P4E0EAtaTPuOl9gsGseFU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029