UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ucUkNOIjBLMdUFVEqNSNYs0SgpQ01bh9vrRvVEiQ/4=' 
WHERE 
  key_id = 'e8fab2a89bf2fb6f48925dd1683e954dcbd089542ca3fecd0b11a1d65ec11ea1' 
  AND (
    token = '6ucUkNOIjBLMdUFVEqNSNYs0SgpQ01bh9vrRvVEiQ/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032