UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NHPx2/YVm6e870dGtiIAtAFBd5N+o4cezwBgVV1h1hQ=' 
WHERE 
  key_id = '4894c9f315b1d37452ed31a86d23d40e830a5ed7feea6df597938f331e6769d3' 
  AND (
    token = 'NHPx2/YVm6e870dGtiIAtAFBd5N+o4cezwBgVV1h1hQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034