UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NXEhHBhGi5F/GaDXMO36d6kNTEEeG1UsiCgGnCyriIQ=' 
WHERE 
  key_id = '062f81bfbcc952ed2609dff6f103ab78b249e98a2938f9aa8eb0b6f890758c2e' 
  AND (
    token = 'NXEhHBhGi5F/GaDXMO36d6kNTEEeG1UsiCgGnCyriIQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042