UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iL/VTUwNm9J43+laE6tVbmCUhkFegU06L5du1L5qBuU=' 
WHERE 
  key_id = '03817a0f31debbc9d2a0aa34df453c8e7f407e7fe1597c1dce4d08dba843f827' 
  AND (
    token = 'iL/VTUwNm9J43+laE6tVbmCUhkFegU06L5du1L5qBuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025