UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Gu+1cjRRiu18cNroyOjMJHc64cLsvnN5M3iLVK8uBs=' 
WHERE 
  key_id = 'bbba80a4502dda356585d58b27f9e82fd9676c13b61f97dab3080cf4c01552b3' 
  AND (
    token = '2Gu+1cjRRiu18cNroyOjMJHc64cLsvnN5M3iLVK8uBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047