UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cH6etivmUm/gbNUXHEJP/GU9q6ho2Vd7+qIJJMVG0ps=' 
WHERE 
  key_id = '15023b6b38eb1e4619e45deb1407becbd31cbba9b8a7360fe998625124466ba1' 
  AND (
    token = 'cH6etivmUm/gbNUXHEJP/GU9q6ho2Vd7+qIJJMVG0ps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026