UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u4gXexIcXmYrdhXvGLyLDcVnZNXUdfKXO5bTvLDZ1+Y=' 
WHERE 
  key_id = '925222e64e63efaf87f8145fced967f3d87947aad8af362f981631986e8b09df' 
  AND (
    token = 'u4gXexIcXmYrdhXvGLyLDcVnZNXUdfKXO5bTvLDZ1+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039