UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd4/2pj/6wQfYf9SBF+IK8X/xVCxpn4JFmkGUUl23W4k=' 
WHERE 
  key_id = '60bb2e1cf3a9167bf2b5d081338bb0ebe406754ede61707b84618fed9e923d8b' 
  AND (
    token = 'd4/2pj/6wQfYf9SBF+IK8X/xVCxpn4JFmkGUUl23W4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038