UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ELtAAJ/DJCy/NesGZ5LY0hrxmpELqj04ELJIvjc3FjE=' 
WHERE 
  key_id = 'b440dffe5466922fd367d1341c2f66ba0a94da97a2a0233c660b1273aed2d2b6' 
  AND (
    token = 'ELtAAJ/DJCy/NesGZ5LY0hrxmpELqj04ELJIvjc3FjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044